<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('编辑订单')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-shop-order-edit" th:object="${order}">
        <input name="id" type="hidden" th:value="*{id}">
        <div class="form-group">
            <label class="col-sm-3 control-label"><span style="color: red; ">*</span>订单号：</label>
            <div class="col-sm-6">
                <input class="form-control" type="text" id="orderSn" readonly th:value="*{orderSn}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label"><span style="color: red; ">*</span>库存状态：</label>
            <div class="col-sm-6">
                <div class="radio-box" th:each="dict : ${@dict.getType('stock_status')}">
                    <input type="radio" th:id="${dict.dictCode}" name="isEnable" th:value="${dict.dictValue}"
                           th:field="*{isEnable}" disabled>
                    <label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label"><span style="color: red; ">*</span>实付金额：</label>
            <div class="col-sm-6">
                <div class="input-group">
                    <span class="input-group-addon">¥</span>
                    <input class="form-control" type="number" name="payCost" th:field="*{payCost}">
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label"><span style="color: red; ">*</span>进货总价：</label>
            <div class="col-sm-6">
                <div class="input-group">
                    <span class="input-group-addon">¥</span>
                    <input class="form-control" type="number" name="buyCost" th:field="*{buyCost}" disabled="">
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label"><span style="color: red; ">*</span>收件人：</label>
            <div class="col-sm-6">
                <input name="receiver" placeholder="请输入收件人" class="form-control" type="text"
                       th:field="*{receiver}" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label"><span style="color: red; ">*</span>收件人手机号：</label>
            <div class="col-sm-6">
                <input name="receiverPhone" placeholder="请输入收件人手机号" class="form-control" type="text"
                       th:field="*{receiverPhone}" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label"><span style="color: red; ">*</span>收货地址(省市）：</label>
            <div class="col-sm-6">
                <input name="receiveDistricts" placeholder="请输入收货地址(省市），如：广东省佛山市" class="form-control" type="text"
                       th:value="*{receiveDistricts}" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label"><span style="color: red; ">*</span>收货详细地址(区及街道门牌号)：</label>
            <div class="col-sm-6">
                <input name="receiveAddress" placeholder="请输入收货详细地址，如：南海区大沥镇九龙公园" class="form-control" type="text"
                       th:value="*{receiveAddress}" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">订单备注：</label>
            <div class="col-sm-6">
                <textarea class="form-control" type="text" name="orderRemark" th:text="*{orderRemark}"></textarea>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">商家备注：</label>
            <div class="col-sm-6">
                <textarea class="form-control" type="text" name="shopRemark" th:text="*{shopRemark}"></textarea>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>

<script type="text/javascript">
    var prefix = ctx + "back/shopOrder";

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-shop-order-edit').serialize());
        }
    }
</script>
</body>
</html>
